<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../../common/assets_header.jsp"/>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>

<script type="text/javascript">

function check() {
	document.getElementById('ok').disabled = 'disabled';
}

function backcompanylist(){
	$("#companyform").attr("action","<%=request.getContextPath()%>/base/company/list");
	$("#companyform").submit();
}
</script>
</head>
<body >
	<!-- content -->	
		<div class="page-content">
			<div class="page-header">
				<h1>
					<c:if test="${baseCompanyInfo.baseCompanyInfoId==null }">新增企业</c:if>
						<c:if test="${baseCompanyInfo.baseCompanyInfoId!=null }">编辑企业</c:if>
								<small>
									<i class="icon-double-angle-right"></i>
									
								</small>
							</h1>
							
					
			</div>
				<div class="row">
					<c:if test="${success}">
						<div class="alert alert-block alert-success">
									<button class="close" data-dismiss="alert"><i class="icon-remove"></i></button>
									<strong><spring:message code="success"></spring:message>!</strong> <spring:message code="save success"></spring:message>！
						</div>
					</c:if>
					
					<c:if test="${success==false}">
						<div class="alert alert-danger">
							<button type="button" class="close" data-dismiss="alert"><i class="icon-remove"></i></button>
							<strong>
								<i class="icon-remove"></i>
								<strong><spring:message code="failure"></spring:message>!</strong> ${message}
							</strong>
						</div>
					</c:if>
					<div class="col-xs-12">
						<form action="<c:if test="${baseCompanyInfo.baseCompanyInfoId==null}">insert</c:if>
				  		  <c:if test="${baseCompanyInfo.baseCompanyInfoId!=null}">edit</c:if>" method="post" class="form-horizontal" id="companyform"
						onsubmit="return check();">
						<input type="hidden" name="searchValue" value="${searchValue}" />
						<input type="hidden" name="id" value="${baseCompanyInfo.baseCompanyInfoId}"></input> 
						<input type="hidden" name="token" value="${token}"></input>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">企业编号：</label>
							<div class="controls">

								<input type="text" maxLength="30"
									<c:if test="${baseCompanyInfo.baseCompanyInfoId!=null}">disabled="disabled"</c:if>
									name="companyCode" value="${baseCompanyInfo.companyCode }"
									class="m-wrap" required />
								<c:if test="${baseCompanyInfo.baseCompanyInfoId!=null}">

									<input type="hidden" name="companyCode"
										value="${baseCompanyInfo.companyCode }"></input>
								</c:if>

								<span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">企业中文名称：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyName"
									value="${baseCompanyInfo.companyName}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">企业英文名称：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyNameKey"
									value="${baseCompanyInfo.companyNameKey}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">企业地址：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyAddr"
									value="${baseCompanyInfo.companyAddr}" class="m-wrap" required />
								<span class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">企业规模：</label>
							<div class="controls">

								<input type="text" maxlength="200" name="companyScale"
									value="${baseCompanyInfo.companyScale}" class="m-wrap" required /> <span
									class="help-inline"></span>

							</div>

						</div>

						<div class="form-group">
							<label class="col-sm-3 control-label no-padding-right" for="form-field-1">被授权：</label>
							<div class="col-sm-9">
								 <input type="radio"
									<c:if test="${baseCompanyInfo.isEnable==1}">checked="checked"</c:if>
									name="isEnable" value="1" /> <spring:message code="yes"></spring:message>

							
								<input type="radio" name="isEnable"
									<c:if test="${baseCompanyInfo.isEnable==0 || baseCompanyInfo.baseCompanyInfoId==null}">checked="checked"</c:if>
									value="0" /> <spring:message code="no"></spring:message>

								
							</div>

						</div>
						<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1">备注：</label>
							<div class="controls">
								<input type="text" maxlength="250" name="companyRemark"
									value="${baseCompanyInfo.companyRemark }" class="m-wrap" required /> <span
									class="help-inline"></span>

							</div>

						</div>

						<div class="form-actions center">

							<button type="submit" id="ok" class="btn btn-xs btn-primary">
								<spring:message code="btn.common.save"></spring:message>
							</button>
							<button type="button" onclick="backcompanylist();" class="btn btn-xs btn-primary">
								<spring:message code="btn.common.back"></spring:message>
							</button>

						</div>

					</form>

				</div>
				</div>

			<!-- BEGIN PAGE CONTAINER-->



		</div>
		<!-- content end -->
		

</body>
</html>